<?php

jimport('joomla.application.component.controller');

class bgController extends JController {
    
    public function __construct(){
        parent::__construct();
        
        
        $this->model = $this->getModel();
    }
    
    public function display($cachable = false, $urlparams = false) {
        parent::display($cachable, $urlparams);
    }

      
    
    
    
    public function selectArea(){
        $area_code = JRequest::getCmd('area_code',0);
        $model = $this->getModel();
        $pref = $model->getAllPref($area_code);
        echo '<select style="width: 130px;" name="pref" id="pref" class="medium">';
        echo '<option value="0" selected="selected">指定しない</option>"';                             
        foreach($pref as $value){                       
            echo '<option value="'.$value->PREF_CODE.'">'.$value->PREF_NAME.'</option>';        
        }                       
        echo '</select>';
        $app = &JFactory::getApplication();
        $app->close();
        exit();
    }
    
    
    
    

    
    
}
?>